﻿using System;
using System.Collections.Generic;
using System.Web.Http;
using YinfangWeb.BLL;
using YinfangWeb.BLL.Enum;
using YinfangWeb.BLL.Model;
using YinfangWeb.MLog;

namespace YinfangWeb.Api.Controllers
{
    public class MerchantController : ApiController
    {
        #region 获取商家列表用于选择组件
        /// <summary>
        /// 获取商家列表用于选择组件
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        /// 1、src\components\BasicType\select_merchant.vue - M
        [HttpGet]
        public IHttpActionResult GetMerchantSelectList(string token)
        {
            try
            {
                var result = new MerchantBO().GetMerchantSelectList();
                return Json(result);
            }
            catch (Exception ex)
            {
                Logger.Default.Error("获取商家列表用于选择组件出错！", ex);
                return Json(new Result(ResultCode.Busy, ex.Message));
            }
        }
        #endregion
    }
}
